package com.yanqu.road.server.cmd.activity.stronghold.wild;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.activity.StrongholdWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdActivityMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = GameProtocol.S_STRONGHOLD_WAR_WILD_DATA_LIST_REQ, desc = "定时拉取据点列表信息")
public class GetStrongholdWildListCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        //直接转发去跨服
        StrongholdWarProto.CrossStrongholdStatusReqMsg.Builder req = StrongholdWarProto.CrossStrongholdStatusReqMsg.newBuilder();
        ActivityInfo activityInfo = StrongholdActivityMgr.getActivityInfo();
        if (activityInfo == null) {
            return;
        }
        req.setActivityId(activityInfo.getActivityId());
        req.setUnionUid(player.getUserInfo().getUnionUid());
        player.sendUnionActivityGroupPacket(Protocol.C_CROSS_STRONGHOLD_WILD_LIST, req, req.getActivityId());
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
